package com.lekang.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lekang.mapper.CheckInApprovalMapper;
import com.lekang.domain.CheckInApproval;
import com.lekang.service.ICheckInApprovalService;

/**
 * 入住申请流程Service业务层处理
 * 
 * @author wjy
 * @date 2025-10-14
 */
@Service
public class CheckInApprovalServiceImpl implements ICheckInApprovalService 
{
    @Autowired
    private CheckInApprovalMapper checkInApprovalMapper;

    /**
     * 查询入住申请流程
     * 
     * @param id 入住申请流程主键
     * @return 入住申请流程
     */
    @Override
    public CheckInApproval selectCheckInApprovalById(Long id)
    {
        return checkInApprovalMapper.selectCheckInApprovalById(id);
    }

    /**
     * 查询入住申请流程列表
     * 
     * @param checkInApproval 入住申请流程
     * @return 入住申请流程
     */
    @Override
    public List<CheckInApproval> selectCheckInApprovalList(CheckInApproval checkInApproval)
    {
        return checkInApprovalMapper.selectCheckInApprovalList(checkInApproval);
    }

    /**
     * 新增入住申请流程
     * 
     * @param checkInApproval 入住申请流程
     * @return 结果
     */
    @Override
    public int insertCheckInApproval(CheckInApproval checkInApproval)
    {
        return checkInApprovalMapper.insertCheckInApproval(checkInApproval);
    }

    /**
     * 修改入住申请流程
     * 
     * @param checkInApproval 入住申请流程
     * @return 结果
     */
    @Override
    public int updateCheckInApproval(CheckInApproval checkInApproval)
    {
        return checkInApprovalMapper.updateCheckInApproval(checkInApproval);
    }

    /**
     * 批量删除入住申请流程
     * 
     * @param ids 需要删除的入住申请流程主键
     * @return 结果
     */
    @Override
    public int deleteCheckInApprovalByIds(Long[] ids)
    {
        return checkInApprovalMapper.deleteCheckInApprovalByIds(ids);
    }

    /**
     * 删除入住申请流程信息
     * 
     * @param id 入住申请流程主键
     * @return 结果
     */
    @Override
    public int deleteCheckInApprovalById(Long id)
    {
        return checkInApprovalMapper.deleteCheckInApprovalById(id);
    }

    @Override
    public List<Map<String, Object>> selectApprovedElderlyInfoList() {
        return checkInApprovalMapper.selectApprovedElderlyInfoList();
    }

    @Override
    public int countApprovingByElderlyId(Long elderlyId) {
        return checkInApprovalMapper.countApprovingByElderlyId(elderlyId);
    }

}
